﻿#ifndef BIGTOOLBUTTON_H
#define BIGTOOLBUTTON_H

#include <QToolButton>

class BigToolButton : public QToolButton
{
    Q_OBJECT

public:

    BigToolButton(QString &image_path, QWidget *parent = Q_NULLPTR);
    void setMousePressed(bool mouse_press);
    void setTextColor(QColor &color);

protected:

    void enterEvent(QEvent *);
    void leaveEvent(QEvent *);
    void paintEvent(QPaintEvent *event);

    // 阴影效果
    void painterShadow(int top_color, int middle_color, int bottom_color);
    // 高亮背景色
    void highLightBg(QString &str_color);


public slots:

    void onToggled(bool is_checked);

public:

    bool m_mouse_over; // 鼠标是否移过
    bool m_is_checked; // 鼠标是否按下

private:
    void createConnections();
};

#endif // BIGTOOLBUTTON_H
